package com.jtny.nytb.equipment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 智慧能源中心 - 伍天宇
 * @package com.jtny.nytb.equipment.enums
 * @fileName DataParamImportEnum.java
 * @createTime 2023年10月16日 14:28
 * @Copyright© 2023 jtny
 * 江投能源技术研究院 版权所有
 */
@AllArgsConstructor
@Getter
public enum DataParamImportEnum {

    /**
     * 关联类型
     */
    RULE("规则", CodeRuleTypeEnum.GENERAL, DataParamRelationTypeEnum.RULE),
    MODEL("模型", CodeRuleTypeEnum.GENERAL, DataParamRelationTypeEnum.MODEL),
    METER_RULE("测点规则", CodeRuleTypeEnum.METER, DataParamRelationTypeEnum.METER_RULE),
    METER_MODEL("测点模型", CodeRuleTypeEnum.METER, DataParamRelationTypeEnum.METER_MODEL),
    EQUIPMENT("设备", CodeRuleTypeEnum.GENERAL, null),
    METER_EQUIPMENT("测点设备", CodeRuleTypeEnum.METER, null);

    /**
     * 关联类型名称
     */
    private String name;

    private CodeRuleTypeEnum codeRuleTypeEnum;

    private DataParamRelationTypeEnum dataParamRelationTypeEnum;

    public static DataParamImportEnum getEnum(String name) {
        for (DataParamImportEnum dataParamImportEnum : DataParamImportEnum.values()) {
            if (dataParamImportEnum.getName().equals(name)) {
                return dataParamImportEnum;
            }
        }
        return null;
    }

}
